Skip to content

gh-115119: Removed bundled copy of the libmpdec#133964

Open
skirpichev wants to merge 28 commits intopython:mainfrom
skirpichev:remove-bundled-mpdecimal/115119
Open

gh-115119: Removed bundled copy of the libmpdec#133964
skirpichev wants to merge 28 commits intopython:mainfrom
skirpichev:remove-bundled-mpdecimal/115119

Conversation

@skirpichev
Copy link
Copy Markdown
Member

@skirpichev skirpichev commented May 13, 2025

@bedevere-app bedevere-app Bot mentioned this pull request May 13, 2025
15 tasks
@skirpichev skirpichev force-pushed the remove-bundled-mpdecimal/115119 branch from 7cba56a to 9d6c9b5 Compare May 13, 2025 15:37
Copy link
Copy Markdown
Member

@AA-Turner AA-Turner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quick comments, haven't looked at build system changes

Comment thread Doc/using/configure.rst
Comment thread Doc/whatsnew/3.13.rst Outdated
Comment thread Doc/whatsnew/3.15.rst Outdated
Comment thread Misc/sbom.spdx.json Outdated
Comment thread Modules/Setup.stdlib.in Outdated
skirpichev and others added 2 commits May 13, 2025 19:21
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
zware
zware previously requested changes May 13, 2025
Comment thread PCbuild/_decimal.vcxproj.filters
@bedevere-app

This comment was marked as resolved.

@AA-Turner

This comment was marked as resolved.

@skirpichev

This comment was marked as resolved.

@bedevere-app

This comment was marked as resolved.

@bedevere-app bedevere-app Bot requested a review from zware May 14, 2025 03:41
@skirpichev

This comment was marked as resolved.

@skirpichev skirpichev force-pushed the remove-bundled-mpdecimal/115119 branch from 0a33f9f to 2ba6b8b Compare May 14, 2025 05:49
@skirpichev skirpichev closed this Aug 16, 2025
@skirpichev skirpichev deleted the remove-bundled-mpdecimal/115119 branch August 16, 2025 06:42
@skirpichev skirpichev restored the remove-bundled-mpdecimal/115119 branch May 8, 2026 03:16
@skirpichev skirpichev reopened this May 8, 2026
@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented May 8, 2026

Documentation build overview

📚 cpython-previews | 🛠️ Build #32613268 | 📁 Comparing 97767d6 against main (49918f5)

  🔍 Preview build  

6 files changed · ± 6 modified

± Modified

@skirpichev skirpichev force-pushed the remove-bundled-mpdecimal/115119 branch from ca84656 to e0bdb87 Compare May 8, 2026 04:28
Copy link
Copy Markdown
Member

@ned-deily ned-deily left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mac/Buildscript/build-installer.py change LGTM

Comment thread .github/workflows/posix-deps-apt.sh Outdated
Comment thread Doc/whatsnew/3.16.rst
* Remove the bundled libmpdec_ decimal library from the CPython source tree,
to simplify maintenence and updates. The :mod:`decimal` module will now
unconditionally use the system's libmpdec decimal library. Also remove the
now unused :option:`!--with-system-libmpdec` :program:`configure` flag.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably mention that binary distributions will still include the _decimal module with libmpdec compiled in.

Comment thread Doc/whatsnew/3.16.rst Outdated
Comment thread Doc/license.rst
decimal.so is not built from a static libmpdec.a since doing so led to
failures on AIX (user report) and Windows (mixing static and dynamic CRTs
causes locale problems and more).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: most of this is out of date, and there are more extra blank lines at the top of the file.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you OK with removal of this?

Comment thread Modules/makesetup Outdated
Comment thread configure.ac Outdated
# _FORTIFY_SOURCE wrappers for memmove and bcopy are incorrect:
# https://sourceware.org/ml/libc-alpha/2010-12/msg00009.html
AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -U_FORTIFY_SOURCE"])
fi
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these still relevant? Is LIBMPDEC_CFLAGS as a whole still relevant, or was it only for the building of libmpdec itself rather than the _decimal module?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, probably also not. I see no memmove(), etc calls.

Comment thread configure.ac Outdated
[with_pydebug], [yes],
[AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -DTEST_COVERAGE"])])

if test "$have_ipa_pure_const_bug" = yes; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regardless of the relevance question below, this is way above the definition down at line 7261.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this case is not relevant anymore. The _decimal.c has not asm code.

Comment thread configure.ac Outdated
AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -fno-ipa-pure-const"])
fi

if test "$have_glibc_memmove_bug" = yes; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also way above the definition.

Comment thread configure.ac
Comment on lines +8296 to +8299
if test "$have_mpdec" = "no"
then
AS_VAR_SET([py_cv_module_]_decimal, [n/a])
fi
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a macro for this:

Suggested change
if test "$have_mpdec" = "no"
then
AS_VAR_SET([py_cv_module_]_decimal, [n/a])
fi
PY_STDLIB_MOD_SET_NA([_decimal])

It should probably go up with the have_mpdec definition, though.

@skirpichev skirpichev requested a review from zware May 9, 2026 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants